<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script>
	var Tune = function(title,type){
		this.title=title;
		this.type=type;
		this.getTitle = function(){
			return "Song: "+this.title+" Type: "+this.type;
		}
	}
	
	var ArtistTune = function(title,type,artist){
		this.artist = artist;
		this.toString("Artist is "+artist);
		//Tune.apply(this,arguments);  //Tune()생성자호출,para1=this로 묶일값   , apply와 call은 인자전달 방법만 다를뿐 똑같은 기능을 한다. 
		Tune.call(this,title,type);
		this.toString=function(){
			return "Artist: "+this.artist+" "+this.getTitle();
		}
	}
	ArtistTune.prototype = new Tune();    //Tune을 상속 받는다. 
	
	var artist = new ArtistTune("hey jude","rock","beatles");
	alert(artist.toString());
</script>
</head>
<body>

</body>
</html>